﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using ADO;

namespace Service.Login
{
    public class LogBackstage:LogIn
    {
       override public bool   EnterInterface()
        {
            return true;
        }
        //-----------------------
       override public void   Initialize(String t_id,String t_password)
        {
            id      = t_id;
            password  = t_password;
        }
        //------------------------------------------------
       override public bool   IsLegal()
        {
            String sqlstr = "";
            string psw;
           if(id == ""|| password == "")
               return false;
           sqlstr = "select Psw from Administrator where AdminID="+id;
           DataBaseAccess DAO = new DataBaseAccess();
           psw = DAO.GetScalar(sqlstr);
            if(psw!=null)
                if (psw.Equals(password))
                {
                    return true;
                }
            return false;
        }
        //-------------------------------------------------
       override public bool Record()
        {
            return true;
        }
        //-----------------------------------------------------
        private String   id;
        private String   password;
    }
}
